/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.nms.base.crm;

import com.nms.base.BaseClass;
import com.nms.crm.imp.beforadd.IsExist;
import com.nms.crm.interfaces.AfterAddInt;
import com.nms.crm.interfaces.BeforAddInt;
import com.nms.errors.ErrorClass;
import java.util.List;

/**
 *
 * @author eisa
 */
public  class Template<T> extends BaseClass<Object> {



    public ErrorClass saveProcessing(Object obj)
    {
        ErrorClass errorClass=null;
        for(BeforAddInt beforAddAction: beforAddActions)
        {
            errorClass=beforAddAction.execute(obj);
            if(errorClass !=null)
                return errorClass;
        }
        save(obj);
        for(AfterAddInt afterAddAction: afterAddActions)
        {
            errorClass=afterAddAction.execute(obj);
            if(errorClass !=null)
                return errorClass;
        }
        
        return null;
    }
}
